package com.yyfax.pay.config.model.to;

import org.apache.commons.lang3.StringUtils;

import com.yyfax.framework.exception.YYException;
import com.yyfax.framework.model.Params;
import com.yyfax.framework.yyfax.enums.RspCodeEnum;

/**
 * 修改商户银行支付路由传入参数
 * 
 * @author changxd
 * @date 2017-04-13
 * @since 1.0.0
 */
@SuppressWarnings("serial")
public class PaymentRouteSaveParams extends Params {

	/** merchant_code 商户编号 */
	private String merchantCode;
	/** bank_code 银行编号 */
	private String bankCode;
	/** payment_code 支付通道编号 */
	private String paymentCode;
	/** state 状态 */
	private String state;
	/** remark 备注 */
	private String remark;
	/** createTime 创建时间 */
	private String createTime;

	@Override
	public boolean validate() throws Exception {

		if (StringUtils.isBlank(merchantCode)) {
			throw new YYException(RspCodeEnum.COMMON_ERROR_PARAMETER_INVALID, "参数 'merchantCode'不能为空");
		}
		if (StringUtils.isBlank(bankCode)) {
			throw new YYException(RspCodeEnum.COMMON_ERROR_PARAMETER_INVALID, "参数 'bankCode'不能为空");
		}
		if (StringUtils.isBlank(paymentCode)) {
			throw new YYException(RspCodeEnum.COMMON_ERROR_PARAMETER_INVALID, "参数 'paymentCode'不能为空");
		}
		if (StringUtils.isBlank(state)) {
			throw new YYException(RspCodeEnum.COMMON_ERROR_PARAMETER_INVALID, "参数 'state'不能为空");
		}
		if (StringUtils.isBlank(remark)) {
			throw new YYException(RspCodeEnum.COMMON_ERROR_PARAMETER_INVALID, "参数 'remark'不能为空");
		}

		return true;
	}

	public String getMerchantCode() {
		return merchantCode;
	}

	public void setMerchantCode(String merchantCode) {
		this.merchantCode = merchantCode;
	}

	public String getBankCode() {
		return bankCode;
	}

	public void setBankCode(String bankCode) {
		this.bankCode = bankCode;
	}

	public String getPaymentCode() {
		return paymentCode;
	}

	public void setPaymentCode(String paymentCode) {
		this.paymentCode = paymentCode;
	}

	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getCreateTime() {
		return createTime;
	}

	public void setCreateTime(String createTime) {
		this.createTime = createTime;
	}

}
